const path = require("path");

function resolve(dir) {
  return path.join(__dirname, dir);
}

module.exports = {
  publicPath:  '/', 
  lintOnSave: true,
  // 生产环境是否生成 sourceMap 文件
  productionSourceMap: false,
  // 开启 CSS source maps?
  css: {
    sourceMap: false,
  },
  chainWebpack: (config) => {
    config.resolve.alias
      .set("@", resolve("src"))
      .set("@/static", resolve("public"))
  },
  //跨域问题
  devServer: {
    disableHostCheck: true,//禁用主机检查 否则无法内网穿透
    proxy: {
      "/api": {
        target: "http://192.168.128.91",
        changeOrigin: true,
        pathRewrite: {
          "^/api": ""
        }
      }
    },
  }
}